<!DOCTYPE html>
<html>
    <head>
        <title>the title</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" type="text/javascript"></script>

        <script type="text/javascript">
            jQuery(document).ready(function(){
                getScoreInToday();
            });
            returnobj={"list":[]}
            function getdata(data) {
                returnobj=data;
                alert(returnobj.list.length);
                return data;
            }

            function getScoreInToday(){
                jQuery.noConflict();
                jQuery.getJSON("https://spreadsheets.google.com/feeds/cells/0Ai_ehSqeQXC8dEh6eGJNUUMzNFJZWmJoS0NLNTRZLVE/1/public/basic?alt=json",
                getscore);
            }


            function getbyrowandcolum(json,row,col,totalcolum){
                return json.feed.entry[col-1+(row-1)*totalcolum].content.$t;
            }
            function getscore(json){
                var today = new Date();
                var dd = today.getDate();
                var mm = today.getMonth()+1;
                var yyyy = today.getFullYear();
                if(dd<10){dd='0'+dd}
                if(mm<10){mm='0'+mm}
                var today = dd+'/'+mm+'/'+yyyy;
                var total=json.feed.entry.length/7;
                var returnobj={"list":[]}
                var j=0;
                for (var i = 2; i <= total; i++) {
                    var ngay = getbyrowandcolum(json,i,1,7);
                    if(ngay==today){
                        var gio=getbyrowandcolum(json,i,2,7);
                        var bang=getbyrowandcolum(json,i,3,7);
                        var san=getbyrowandcolum(json,i,4,7);
                        var doi1=getbyrowandcolum(json,i,5,7);
                        var doi2=getbyrowandcolum(json,i,6,7);
                        var tiso=getbyrowandcolum(json,i,7,7);
                        returnobj.list[j++]={"ngay":ngay,"gio":gio,"bang":bang,
                            "san":san,"doi1":doi1,"doi2":doi2,"tiso":tiso};
                    }
                }
                getdata(returnobj)
                return returnobj;
            }
        </script>
    </head>

    <body>
        <p class="inhalt"></p>
    </body>
</html>